Icons
Icons to replace default ones in the library should be in vector format packed in XML. New icons should have the correct naming format and be stored in the res/drawable directory.
Access to icons is done by referring to resources and creating a VectorResource
object (which can only be initialized in a Composable function).
Changing DxCharts library icons is done by implementing interfaces in the com.devexperts.dxcharts.lib.ui.theme.icons
package:
com.devexperts.dxcharts.lib.ui.theme.icons.CommonIcons
com.devexperts.dxcharts.lib.ui.theme.icons.StudiesIcons
com.devexperts.dxcharts.lib.ui.theme.icons.ToolbarIcons
com.devexperts.dxcharts.lib.ui.theme.icons.TopBarIcons
You can find all icons and their names and default implementation here
val commonIcons = object : CommonIcons {override val Erase: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon1)override val Bin: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon2)/*Other values overriding*/}val studiesIcons = object : StudiesIcons {override val ListItem: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon3)override val LineType: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon4)/*Other values overriding*/}val toolbarIcons = object : ToolbarIcons {override val Brush: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon5)override val ChartTypes: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon6)/*Other values overriding*/}val topBarIcons = object : TopBarIcons {override val ArrowBack: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon7)override val ArrowForward: ImageVector@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon8)}DxChartsTheme(commonIcons = commonIcons,studiesIcons = studiesIcons,toolbarIcons = toolbarIcons,topBarIcons = topBarIcons) {/* content */}
Initialization can also be done using default icons:
com.devexperts.dxcharts.lib.ui.theme.icons.DefaultCommonIcons
com.devexperts.dxcharts.lib.ui.theme.icons.DefaultStudiesIcons
com.devexperts.dxcharts.lib.ui.theme.icons.DefaultToolbarIcons
com.devexperts.dxcharts.lib.ui.theme.icons.DefaultTopBarIcons
val topBarIcons = object : TopBarIcons {override val ArrowBack: ImageVector // Initialization with new icon resourse@Composable get() = ImageVector.vectorResource(id = R.drawable.ic_icon7)override val ArrowForward: ImageVector // Initialization with default icon@Composable get() = DefaultTopBarIcons.ArrowForward}DxChartsTheme(topBarIcons = topBarIcons) {/* content */}